home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 27 / CDROM27.iso / share / progra / mai / Application, properly unloading all forms in Form_Unload() < prev    next >
Encoding:
Text File  |  1997-07-14  |  375 b   |  19 lines

  1. 'Description: Unloads an application properly ensuring restoration of resources
  2.  
  3. 'Place the following code in a Form_Unload()
  4.  
  5. Dim i as integer
  6. While forms.Count > 1
  7.     ' Find first form besides "me" to unload
  8.     i = 0
  9.  
  10.     While forms(i).Caption = Me.Caption
  11.          i = i + 1
  12.     Wend
  13.  
  14.     Unload forms(i)
  15. Wend
  16.  
  17. ' Last thing to be done...
  18. Unload Me
  19. End